import * as asyncWx from "../../utils/asyncWx.js";
import {request} from "../../request/index.js";
Page({
    //点击授权按钮事件监听
    async handleGetUserInfo(e){
        const {encryptedData,iv,rawData,signature}=e.detail;
        const {code}=await asyncWx.login();
        const tokenParams={encryptedData,iv,rawData,signature,code};
        //因为没有企业账号权限，故调用此接口无法获得token，故用假token代替，完成效果
        // const {token}=await request({url:"/users/wxlogin",method:"post",data:tokenParams});
        const token="adfkajsdfjajsdfajdjfajsenrwemdwejdnwejdqkweddjadasdlsadsd";
        wx.setStorageSync("token",token);//缓存token
        wx.navigateBack({
          delta: 1
        });
    }
})